<?php

namespace services\models;

/**
 * This is the ActiveQuery class for [[Promotion]].
 *
 * @see Promotion
 */
class PromotionQuery extends \yii\db\ActiveQuery
{
    /*public function active()
    {
        return $this->andWhere('[[status]]=1');
    }*/

    /**
     * @inheritdoc
     * @return Promotion[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return Promotion|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }

    /**
     * @param int $bestry_id
     * @return null|Promotion
     */
    public function byBestryUid($bestry_id){
        return $this->where(['bestry_id'=>$bestry_id])->one();
    }
}
